Field of the Invention
The present invention relates to a measurement apparatus and measurement method which measure the shape of a surface to be measured.
Description of the Related Art
An optical measurement apparatus is one of techniques of evaluating the shape of a surface to be measured. Optical measurement apparatuses based on various types of schemes are available. A scheme called a pattern projection method is one of these schemes. This scheme is designed to measure the shape of a surface to be measured (target object) by performing image sensing by projecting a predetermined projection pattern on the surface and calculating distance information at each pixel position from the principle of triangulation. Pattern projection methods are further classified into a plurality of schemes according to pattern projection methods, which include a multi-shot scheme of projecting a plurality of patterns, such as a phase shift method or a space encoding method, and a single-shot scheme of projecting a pattern once. When measuring a surface to be measured which moves at high speed, it is difficult to perform the measurement by using the multi-shot scheme, and hence the single-shot scheme is used for the measurement.
When using the single-shot scheme, various contrivances are employed for pattern light to specify that each pixel of a sensed image indicates the information of specific coordinates of the pattern light. For example, there are available a dot line scheme designed to provide dots, each of which is identifiable, on stripe pattern lines, a line width modulation scheme designed to change a line width for identifying each line, a random dot scheme designed to project randomly arranged dots, and the like. These measurement methods are designed to detect dots, lines, and the like and reconstruct coordinate information based on spatial distribution information of brightnesses obtained from a sensed image. However, spatial distribution information of brightness levels is data including the influences of a reflectance distribution on a surface to be measured, the bias of the illuminance distribution of a light source, background light, and the like. These influences may cause errors in the detection of dots and lines or may lead to inability to perform detection itself. As a consequence, the accuracy of measured shape information deteriorates. When considering a measurement apparatus capable of coping with a wide surface to be measured, it is necessary to minimize the influence of a reflectance distribution on the surface to be measured.
With regard to the above problem, a technique according to Japanese Patent Laid-Open No. 3-289505 obtains not only an image (pattern image) upon irradiation with pattern light but also an image (uniform illumination image) upon irradiation with uniform illumination light. Using the data of a uniform illumination image as correction data makes it possible to remove, from a pattern image, a distortion caused by a variation in a reflectance distribution on a surface to be measured or the bias of the illuminance distribution of a light source. Since the coordinate information of each line is accurately detected from the corrected pattern image, the shape and position of the surface to be measured can be accurately measured. A technique according to Japanese Patent No. 3884321 is directed to a color pattern projection measurement method using a pattern having a plurality of color components. In this case, since a color distribution on the surface to be measured varies in reflectance with respect to light having various wavelengths. This, in particular, makes it difficult to reconstruct coordinate information on a deep color surface to be measured. In contrast to this, the shape information of a surface to be measured can be obtained independently of its color distribution by correcting a pattern image using an image obtained by irradiating a surface to be measured with light from a light source not via a pattern forming apparatus.
According to Japanese Patent Laid-Open No. 3-289505, a pattern image and a uniform illumination image are sensed from light emitted from the same light source, and a liquid crystal shutter switches between using and not using a pattern at the time of obtaining the two images. For this reason, the two images are not obtained at the same time. According to Japanese Patent No. 3884321 as well, a transmission type liquid crystal apparatus switches between using and not using a pattern, and the two images are obtained at different timings. From the viewpoint of correction, it is necessary to match image sensing conditions for the two images as much as possible. It is therefore taken for granted that measurement is performed at the same wavelength by using light from the same light source. In this case, it is impossible to obtain two images at the same timing.
On the other hand, when considering the application of a shape measurement apparatus, the relative positional relationship between a surface to be measured and an image sensor is not always constant. When considering a case of using, for example, a measurement apparatus as a machine vision, there can be situation in which a surface to be measured moves on a belt conveyor, and the shape information of the moving surface needs to be obtained in real time. In addition, when it is necessary to grip a target object, it is necessary to calculate, in real time, the relative positions of the object and a grip unit which moves to grip, in consideration of throughput. In the following description, such measurement which requires to grasp the shape information of a surface to be measured in real time is written as movement measurement.
The conventional techniques disclosed in Japanese Patent Laid-Open No. 3-289505 and Japanese Patent No. 3884321 are designed to obtain a pattern image and an image for correcting it at different timings. For this reason, under the environment of movement measurement in which measurement is performed while a target object or an image sensing unit is moving, two images are sensed in different visual fields. According to the related art, therefore, it is difficult to accurately correct a pattern image, or it is necessary to correct the influence of a change in visual field accompanying movement on the image.